import { fromJS } from 'immutable'
import defaultState from '../state/equip'
import method from '../method/equip'

const reducer = (state = defaultState, action) => {
  try {
    return method[action.type](state , fromJS(action.data))
  } catch (error) {
    return state
  }
}

export default reducer